import random


def get_color():
    return random.randrange(256)

def generate_code():
    source = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
    code = ""

    for i in range(4):
        # 随机选一个拼在code上，一共拼4位
        code += random.choice(source)

    return code
